home *** CD-ROM | disk | FTP | other *** search
/ Mac Action 1996 January / mac-action-07.iso / mac / Inside Action / Total Distortion Big Demo / aaShelf.Dxr / 00006.ls < prev    next >
Encoding:
Text File  |  1995-06-05  |  6.2 KB  |  408 lines

  1. on startMovie
  2.   InitLibraryman()
  3. end
  4.  
  5. on settempcounter
  6.   global BookTempCounter
  7.   set BookTempCounter to 0
  8. end
  9.  
  10. on checktempcounter
  11.   global BookTempCounter
  12.   set BookTempCounter to BookTempCounter + 1
  13.   if BookTempCounter > 100 then
  14.     GoMenu()
  15.   end if
  16. end
  17.  
  18. on stopMovie
  19.   global LibraryMan
  20.   set LibraryMan to 0
  21. end
  22.  
  23. on InitLibraryman
  24.   global LibraryMan
  25.   set LibraryMan to birth(script "LibraryMan.script")
  26. end
  27.  
  28. on initnode a, b, c, d, e, f
  29.   global navbrain, LocQT, LocDB
  30.   SolveLQT(a)
  31.   navbrain(initnode, a, b, c, d, e, f)
  32. end
  33.  
  34. on KeyNav x
  35.   global navbrain
  36.   if (x = 123) or (x = 0) then
  37.     navbrain(NavNow, "L", 0)
  38.   else
  39.     if (x = 124) or (x = 2) then
  40.       navbrain(NavNow, "R", 0)
  41.     else
  42.       if (x = 126) or (x = 13) then
  43.         navbrain(NavNow, "F", 0)
  44.       else
  45.         if (x = 125) or (x = 1) then
  46.           navbrain(NavNow, "B", 0)
  47.         end if
  48.       end if
  49.     end if
  50.   end if
  51. end
  52.  
  53. on SolveLQT node
  54.   global LocQT, LocPref
  55.   set LocPref to "TwrBedRm"
  56.   set LocQT to "TwrBedRm.MOV"
  57. end
  58.  
  59. on installLocDB
  60.   global LocQT, LocPref, dbBG, NSnBG, dbMID, NSnMID, dbFORE, NSnFORE, dbAUD, NSnAUD, dbMUS, NSnMUS
  61.   if "TwrBedRm" contains LocPref then
  62.     jamBG(LocPref)
  63.   end if
  64. end
  65.  
  66. on jamBG rec
  67.   global dbBG, NSnBG
  68.   if dbBG contains rec then
  69.     exit
  70.   else
  71.     put "," & rec after dbBG
  72.     set NSnBG to the number of items in dbBG
  73.   end if
  74. end
  75.  
  76. on jamMID rec
  77.   global dbMID, NSnMID
  78.   if dbMID contains rec then
  79.     exit
  80.   else
  81.     put "," & rec after dbMID
  82.     set NSnMID to the number of items in dbMID
  83.   end if
  84. end
  85.  
  86. on jamFORE rec
  87.   global dbFORE, NSnFORE
  88.   if dbFORE contains rec then
  89.     exit
  90.   else
  91.     put "," & rec after dbFORE
  92.     set NSnFORE to the number of items in dbFORE
  93.   end if
  94. end
  95.  
  96. on jamAUD rec
  97.   global dbAUD, NSnAUD
  98.   if dbAUD contains rec then
  99.     exit
  100.   else
  101.     put "," & rec after dbAUD
  102.     set NSnAUD to the number of items in dbAUD
  103.   end if
  104. end
  105.  
  106. on jamMUS rec
  107.   global dbMUS, NSnMUS
  108.   if dbMUS contains rec then
  109.     exit
  110.   else
  111.     put "," & rec after dbMUS
  112.     set NSnMUS to the number of items in dbMUS
  113.   end if
  114. end
  115.  
  116. on BookIt
  117.   global NowBOOK, turnbrain
  118.   turnbrain(Event, 1)
  119.   go(1, NowBOOK)
  120. end
  121.  
  122. on BKIT x
  123.   global NowBOOK
  124.   set NowBOOK to x
  125.   go(x)
  126. end
  127.  
  128. on LowBookNpull
  129.   set x to the mouseH
  130.   if x < 118 then
  131.     BKIT("beHaight")
  132.     exit
  133.   end if
  134.   if x < 133 then
  135.     BKIT("beFFace2")
  136.     exit
  137.   end if
  138.   if x < 149 then
  139.     BKIT("beArtGHM")
  140.     exit
  141.   end if
  142.   if x < 165 then
  143.     BKIT("beFavChd")
  144.     exit
  145.   end if
  146.   if x < 178 then
  147.     BKIT("beZooPuz1")
  148.     exit
  149.   end if
  150.   if x < 190 then
  151.     BKIT("beZooPuz2")
  152.     exit
  153.   end if
  154.   if x < 201 then
  155.     BKIT("beZooPuz3")
  156.     exit
  157.   end if
  158.   if x < 217 then
  159.     BKIT("beZooPuz4")
  160.     exit
  161.   end if
  162.   if x < 230 then
  163.     BKIT("beLBN09")
  164.     exit
  165.   end if
  166.   if x < 245 then
  167.     BKIT("beLBN10")
  168.     exit
  169.   end if
  170.   if x < 257 then
  171.     BKIT("beLBN11")
  172.     exit
  173.   end if
  174.   if x < 271 then
  175.     BKIT("beLBN12")
  176.     exit
  177.   end if
  178.   if x < 285 then
  179.     BKIT("beLBN13")
  180.     exit
  181.   end if
  182.   if x < 298 then
  183.     BKIT("beLBN14")
  184.     exit
  185.   end if
  186.   if x < 312 then
  187.     BKIT("beLBN15")
  188.     exit
  189.   end if
  190.   if x < 323 then
  191.     BKIT("beLBN16")
  192.     exit
  193.   end if
  194.   if x < 336 then
  195.     BKIT("beLBN17")
  196.     exit
  197.   end if
  198.   if x < 348 then
  199.     BKIT("beLBN18")
  200.     exit
  201.   end if
  202.   if x < 365 then
  203.     BKIT("beLBN19")
  204.     exit
  205.   end if
  206.   if x < 379 then
  207.     BKIT("beLBN20")
  208.     exit
  209.   end if
  210.   if x < 392 then
  211.     BKIT("beLBN21")
  212.     exit
  213.   end if
  214. end
  215.  
  216. on TopBookNpull
  217.   global NowBOOK
  218.   set x to the mouseH
  219.   if x < 150 then
  220.     BKIT("beTDTips")
  221.     exit
  222.   end if
  223.   if x < 166 then
  224.     BKIT("beFFace1")
  225.     exit
  226.   end if
  227.   if x < 181 then
  228.     BKIT("beSFists")
  229.     exit
  230.   end if
  231.   if x < 195 then
  232.     BKIT("beBeatnk")
  233.     exit
  234.   end if
  235.   if x < 210 then
  236.     BKIT("bePuzzl1")
  237.     exit
  238.   end if
  239.   if x < 221 then
  240.     BKIT("beHStar")
  241.     exit
  242.   end if
  243.   if x < 234 then
  244.     BKIT("beGROOVI")
  245.     exit
  246.   end if
  247.   if x < 247 then
  248.     BKIT("beEngRM")
  249.     exit
  250.   end if
  251.   if x < 260 then
  252.     BKIT("beSmashn")
  253.     exit
  254.   end if
  255.   if x < 274 then
  256.     BKIT("beVidDrv")
  257.     exit
  258.   end if
  259.   if x < 289 then
  260.     BKIT("beFoodBr")
  261.     exit
  262.   end if
  263.   if x < 305 then
  264.     BKIT("beFoodG")
  265.     exit
  266.   end if
  267.   if x < 317 then
  268.     BKIT("beDrink")
  269.     exit
  270.   end if
  271.   if x < 332 then
  272.     BKIT("beTDVS")
  273.     exit
  274.   end if
  275.   if x < 342 then
  276.     BKIT("beStatMon")
  277.     exit
  278.   end if
  279.   if x < 356 then
  280.     BKIT("beRadio")
  281.     exit
  282.   end if
  283.   if x < 369 then
  284.     BKIT("beVidFon")
  285.     exit
  286.   end if
  287. end
  288.  
  289. on WestBookPull
  290.   set x to the mouseH
  291.   if x < 176 then
  292.     BKIT("bePsyMap")
  293.     exit
  294.   end if
  295.   if x < 191 then
  296.     BKIT("beESPman")
  297.     exit
  298.   end if
  299.   if x < 206 then
  300.     BKIT("beLBW03")
  301.     exit
  302.   end if
  303.   if x < 220 then
  304.     BKIT("beLBW04")
  305.     exit
  306.   end if
  307.   if x < 235 then
  308.     BKIT("beLBW05")
  309.     exit
  310.   end if
  311.   if x < 247 then
  312.     BKIT("beLBW06")
  313.     exit
  314.   end if
  315.   if x < 259 then
  316.     BKIT("beLBW07")
  317.     exit
  318.   end if
  319.   if x < 272 then
  320.     BKIT("beLBW08")
  321.     exit
  322.   end if
  323.   if x < 284 then
  324.     BKIT("beLBW09")
  325.     exit
  326.   end if
  327.   if x < 300 then
  328.     BKIT("beLBW10")
  329.     exit
  330.   end if
  331.   if x < 313 then
  332.     BKIT("beLBW11")
  333.     exit
  334.   end if
  335.   if x < 327 then
  336.     BKIT("beLBW12")
  337.     exit
  338.   else
  339.     BKIT("beLBW13")
  340.   end if
  341. end
  342.  
  343. on gosleep x
  344.   global SleepRec, navbrain
  345.   navbrain(TagSPlace)
  346.   if SleepRec = EMPTY then
  347.     set SleepRec to "1," & x
  348.   else
  349.     put x into item 2 of SleepRec
  350.   end if
  351.   go("Rest." & x)
  352. end
  353.  
  354. on Wakeup
  355.   global SleepRec, navbrain, SPlace
  356.   navbrain(jump, SPlace)
  357. end
  358.  
  359. on trysleep
  360.   global UMental
  361.   set randseed to random(10)
  362.   if UMental > 90 then
  363.     set SleepGo to "noSleep"
  364.   else
  365.     if (UMental > 69) and (randseed > 6) then
  366.       set SleepGo to "noSleep"
  367.     else
  368.       if (UMental > 50) and (randseed > 8) then
  369.         set SleepGo to "noSleep"
  370.       else
  371.         set SleepGo to "Sleep"
  372.       end if
  373.     end if
  374.   end if
  375.   go(SleepGo)
  376. end
  377.  
  378. on SleepAction
  379.   global turnbrain, UMental
  380.   turnbrain(setMuteChek, "mental")
  381.   turnbrain(setMuteAct, "all")
  382.   set n to random(7) + 6
  383.   turnbrain(Event, n)
  384.   turnbrain(resetcheks)
  385.   Dream()
  386. end
  387.  
  388. on Dream
  389.   go(1, "bdDREAMA")
  390. end
  391.  
  392. on CBallVision
  393.   global TwrPwr
  394.   set TwrPwr to TwrPwr - 1
  395.   go("CBallVision." & random(6))
  396. end
  397.  
  398. on Indhelp
  399.   global tframe
  400.   set tframe to the frame
  401.   go("IndHelp")
  402. end
  403.  
  404. on pageturn a
  405.   puppetSound("BookPage.1")
  406.   go("Index." & a)
  407. end
  408.